package com.xxl.job.executor.service;

import com.xxl.job.executor.model.*;
import com.xxl.job.executor.repository.CurrentInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 查询实时数据
 */
@Service
public class CurrentInfoService {

    @Autowired
    private CurrentInfoRepository currentInfoRepository;

    /**
     * 查询环控系统
     * @param devCode
     * @param signalCode
     * @return
     */
    public CurrentInfoHkModel queryHkCurrent(String devCode,String signalCode) {
        return currentInfoRepository.queryHkCurrent(devCode,signalCode);
    }

    /**
     * 查询电话系统
     *  @param devCode
     *  @param signalCode
     * @return
     */
    public CurrentInfoDhModel queryDhCurrent(String devCode,String signalCode) {
        return currentInfoRepository.queryDhCurrent(devCode,signalCode);
    }

    /**
     * 查询入侵系统
     *  @param devCode
     *  @param signalCode
     * @return
     */
    public CurrentInfoRqModel queryRqCurrent(String devCode,String signalCode) {
        return currentInfoRepository.queryRqCurrent(devCode,signalCode);
    }

    /**
     * 查询消防系统
     *  @param devCode
     *  @param signalCode
     * @return
     */
    public CurrentInfoXfModel queryXfCurrent(String devCode,String signalCode) {
        return currentInfoRepository.queryXfCurrent(devCode,signalCode);
    }

    /**
     * 查询AP系统
     *  @param devCode
     *  @param signalCode
     * @return
     */
    public CurrentInfoApModel queryApCurrent(String devCode, String signalCode) {
        return currentInfoRepository.queryApCurrent(devCode,signalCode);
    }

    /**
     * 查询采集口系统
     *  @param devCode
     *  @param signalCode
     * @return
     */
    public CurrentInfoGatherModel queryGatherCurrent(String devCode, String signalCode) {
        return currentInfoRepository.queryGatherCurrent(devCode,signalCode);
    }

    /**
     * 保存环控系统
     * @param currentInfoHkModel
     */
    public void save(CurrentInfoHkModel currentInfoHkModel) {
        currentInfoRepository.save(currentInfoHkModel);
    }

    /**
     * 保存电话系统
     * @param currentInfoDhModel
     */
    public void save(CurrentInfoDhModel currentInfoDhModel) {
        currentInfoRepository.save(currentInfoDhModel);
    }

    /**
     * 保存入侵系统
     * @param currentInfoRqModel
     */
    public void save(CurrentInfoRqModel currentInfoRqModel) {
        currentInfoRepository.save(currentInfoRqModel);
    }

    /**
     * 保存消防系统
     * @param currentInfoXfModel
     */
    public void save(CurrentInfoXfModel currentInfoXfModel) {
        currentInfoRepository.save(currentInfoXfModel);
    }

}
